<?php
require './include/global.php';
require './include/validate.php';
require './include/all_left.php';
require_once './include/advisory_db.php';

$appid = $_GET[id];

$sql = "SELECT * FROM pa_resume WHERE re_id = '".$_POST['postid']."' AND re_uid= '".$_SESSION['uid']."' AND re_usertype = 'recruiter' ";
$rs = $DB->fetch_one_array($sql);

if(empty($rs)){
	  echo "<meta http-equiv=\"refresh\" content=\"0;URL=errorall.php?errid=rc_1012\">";
	  exit;
}

if($_FILES["app_incresume"][name]!='' && $_POST['app_includeresume'] <> 1){
	   $f = new upfile("./uploadfiles/previewresume/","doc,docx,txt,pdf");
	   if($f->upload("app_incresume")){
		 $filename1 = $f->savename;
	   }
}
//print_r($rs);
ob_clean();
ob_start();
	   $cpforms->formheader(array('title'=>'', 'name'=>'article'));
	   $view =1;
		
	   $cpforms->longline(array('title'=>"Applicant Detail"));
	   $cpforms->gethightext(array('text'=>"Availability Status",'value'=>'Active','read'=>"$read",'view'=>"$view"));
	   $cpforms->gethightext(array('text'=>"Nick Name",'value'=>$rs[re_nickname],'read'=>"$read",'view'=>"$view"));
	   
	   if($_SESSION[usertype]!="employer" && $rs[re_aliasname]!=''){
	   $cpforms->gethightext(array('text'=>"Alias Name",'value'=>$rs[re_aliasname],'read'=>"$read",'view'=>"$view"));
	   }
		$city = ($rs[re_locity] == '')?"N/A":$rs[re_locity];
	    $states = ($rs[re_lostate]==0)?"N/A":$state[$rs[re_lostate]];
	   $cpforms->gethightext(array('text'=>"Location",'value'=>$city.", ".$states.", ".$country[$rs[re_locountry]],'read'=>"$read",'view'=>"$view"));
	   $cpforms->gethightext(array('text'=>"Current Job Title",'value'=>"<b><font color='blue'>".$rs[re_jobtitle]."</font></b>",'read'=>"$read",'view'=>"$view"));
	   $cpforms->gethightext(array('text'=>"Current Annual Base Salary",'value'=>"$".number_format($rs[re_currentpay]),'read'=>"$read",'view'=>"$view"));
	   $cpforms->gethightext(array('text'=>"Desired Annual Base Salary",'value'=>"$".number_format($rs[re_desiredpay]),'read'=>"$read",'view'=>"$view"));
	  
		$sql = "SELECT rc_fname,rc_lname FROM pa_recuiter WHERE rc_id =  '".$rs[app_recruitid]."' ";
		$rcInfo = $DB->fetch_one_array($sql);
		$cpforms->gethightext(array('text'=>"Recruiter Contact",'value'=>"<a href='recdetail.php?id=".$rs[app_recruitid]."' target='_blank'>".$rcInfo[rc_fname]." ".$rcInfo[rc_lname]."</a>",'read'=>"$read",'view'=>"$view"));
	   $cpforms->maketextarea2(array('text'=>"Recruiter Note",'value'=>$_POST['app_note'],'read'=>"$read",'view'=>"$view"));

	   $cpforms->longline(array('title'=>"Applicant Qualifications"));
	   $cpforms->gethightext(array('text'=>"Schools Attended",'value'=>$rs[re_schoolattend],'read'=>"$read",'view'=>"$view"));
	   $_education = ($rs[re_edulevel]==0)?"N/A":$education[$rs[re_edulevel]];
	   $_yearexp = ($rs[re_yearexp]==0)?"N/A":$yearexp2[$rs[re_yearexp]];
	   $_mgmt = ($rs[re_mgmt]==0)?"N/A":$yearexp2[$rs[re_mgmt]];
	   $_profit = ($rs[re_profit]==0)?"N/A":$yearexp2[$rs[re_profit]];

	   $cpforms->gethightext(array('text'=>"Highest Degree",'value'=>$_education,'read'=>"$read",'view'=>"$view"));
	   $cpforms->gethightext(array('text'=>"Years of Relevant Work Experience",'value'=>$_yearexp,'read'=>"$read",'view'=>"$view"));
	   $cpforms->gethightext(array('text'=>"Years of People Management Experience",'value'=>$_mgmt,'read'=>"$read",'view'=>"$view"));
	   $cpforms->gethightext(array('text'=>"Years of Profit & Loss Responsibility ",'value'=>$_profit,'read'=>"$read",'view'=>"$view"));
	   $rs[re_detail] = str_replace("<!--[if !supportLists]-->","",$rs[re_detail]);
	   $rs[re_detail] = str_replace("<!--[endif]-->","",$rs[re_detail]);

	   $fileurl = ($filename1 != '')? './uploadfiles/previewresume/'.$filename1:'./uploadfiles/resumes/'.$rs['re_uploadresume'];
	   if($filename1 == '' && $rs['re_uploadresume']=='') $fileurl = '';
	   if($_POST['app_includeresume'] <> 1 && $rs['re_uploadresume'] != '' && $filename1 == '') $fileurl = '';
	   $cpforms->maketextarea2(array('text'=>"Resume Details",'value'=>($rs[re_detail]),'read'=>"$read",'view'=>"$view",'fileurl'=>$fileurl));
		 
	   $cpforms->longline(array('title'=>"Work Status, Employment and Professional References"));
	   $cpforms->gethightext(array('text'=>"Authorized to Work Locations",'value'=>$rs[re_authorize],'read'=>"$read",'view'=>"$view"));  
	   $cpforms->gethightext(array('text'=>"Three Previous Employers",'value'=>$rs[re_prvemployer],'read'=>"$read",'view'=>"$view"));
	   $cpforms->gethightext(array('text'=>"Previous Employment Status Checked?",'value'=>$YESNO[$rs[re_prvempstatus]],'read'=>"$read",'view'=>"$view"));
	   $cpforms->gethightext(array('text'=>"Three Professional References Available?",'value'=>$YESNO[$rs[re_professavilable]],'read'=>"$read",'view'=>"$view"));
	  
	  
	   echo "<tr class=\"tbhead\"><td colspan=\"2\" align=\"center\" bgcolor=\"#F0F0F0\"><input class=\"bginput button-secondary\" type=\"button\" value=\"Close\" onclick=\"window.close()\">";
	   echo "</td></tr>";
	   echo "</table></td></tr></table>\n";
	   $content = ob_get_contents();
       ob_end_clean();


$smarty->assign("content",$content);
$smarty->assign("rid",$appid);

$smarty->compile_check = true;

$smarty->display('header.tpl');

$smarty->display('allleft.tpl');
$smarty->display('previewsubmitapplicant.tpl');
$smarty->display('allright.tpl');
$smarty->display('footer.tpl');
?>